package view.components;

import java.util.Map;
import java.util.TreeMap;

import util.resources.ResourceManager;

/**
 * Read properties for view components
 * 
 * @author Yin
 * 
 */
public class ComponentsFactory {

    private static Map<String, String> myComponents;

    public static void loadComponents(String componentResourceFile) {
        ResourceManager resources = ResourceManager
                .getManager(componentResourceFile);

        myComponents = new TreeMap<String, String>();
        for (String str : resources) {
            myComponents.put(str, resources.getStringArray(str)[0]);
        }
    }

    public static Map<String, String> getComponentsMap() {
        return myComponents;
    }

}
